/**
 * Created by johwa on 2014/9/30.
 */
var mongodb = require('./mongoose');

var Schema = mongodb.mongoose.Schema;

var MovieSchema = new Schema({
    name:String,
    alias:[String],
    publish : Date,
    create_data : {type:Date, default: Date.now},
    images : {
        coverSmall:String,
        coverBig:String
    },
    source:[{
        source:String,
        link:String,
        swfLink:String,
        quality:String,
        version:String,
        lang:String,
        subtitle:String,
        create_data : { type: Date, default: Date.now}
    }]

});

var Movie = mongodb.mongoose.model("Movie",MovieSchema);
var MovieDAO = function(){};

MovieDAO.prototype.save = function(obj,callback){
    var instance = new  Movie(obj);
}

module.exports = new MovieDAO();
